package org.weso.acota.jsf.beans;

import java.util.List;

import org.weso.acota.services.CotaServiceFacade;
import org.weso.acota.services.CotaServiceFacadeImpl;
import org.weso.acota.to.RequestSuggestionTO;
import org.weso.acota.to.TagTO;

public class AcotaBean {

	private List<TagTO>tags;
	private String tag;
	private CotaServiceFacade facade;
    
	public AcotaBean(){
        this.facade = new CotaServiceFacadeImpl();
    }

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	public List<TagTO> getTags() {
		return tags;
	}

	public void setTags(List<TagTO> tags) {
		this.tags = tags;
	}
	
	public List<TagTO> autocomplete(Object suggest) {
		 RequestSuggestionTO request = new RequestSuggestionTO((String)suggest);
	     return this.facade.suggest(request).getTags();
    }
	
	
}